package com.daoxiang.service.impl;

import com.daoxiang.dao.ShoppingCartMapper;
import com.daoxiang.pojo.ShoppingCart;
import com.daoxiang.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {

    @Autowired
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public int insertShoppingCart(ShoppingCart shoppingCart) {
        return this.shoppingCartMapper.insert(shoppingCart);
    }

    @Override
    public ShoppingCart queryShoppingCartByUidAndGid(ShoppingCart shoppingCart) {
        return this.shoppingCartMapper.selectByPrimaryKey(shoppingCart);
    }

    @Override
    public int updateShoppingCart(ShoppingCart shoppingCart) {
        return this.shoppingCartMapper.updateByPrimaryKey(shoppingCart);
    }

    @Override
    public int deleteShoppingCart(ShoppingCart shoppingCart) {
        return this.shoppingCartMapper.deleteByPrimaryKey(shoppingCart);
    }
}
